<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

/**
 * 小程序
 * @package
 */
class CreateMinisTable extends Migration
{
    public function up()
    {
        Schema::create('minis', function (Blueprint $table) {
            $table->id();
            $table->foreignId('site_id')->constrained()->onDelete('cascade');
            $table->string('title')->comment('小程序名称');
            $table->string('introduce')->comment('小程序介绍');
            $table->string('qr')->nullable()->comment('二维码');
            $table->string('appid')->unique();
            $table->string('secret')->comment('密钥');
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('minis');
    }
}
